<template>
	<uv-popup ref="popupRef" :round='15' :safeAreaInsetBottom='false' @change="change">
		<div class="qrcode">
			<image :src="file.getFileUrl(kefuQrcode)" mode="widthFix"></image>
		</div>
	</uv-popup>
</template>

<script setup>
	import file from '@/utils/file/index.js'
	import { ref, computed, nextTick } from 'vue';
	import { useGeneralStore } from '@/store/general.js'

	const generalStore = useGeneralStore();

	const popupRef = ref(null);

	const kefuQrcode = computed(() => generalStore.systemData.base.kefuQrcode);

	function open(val) {
		nextTick(() => {
			popupRef.value && popupRef.value.open();
		})
	}

	function close() {
		nextTick(() => {
			popupRef.value && popupRef.value.close();
		})
	}

	function change(e) {}

	defineExpose({
		open,
		close
	})
</script>

<style scoped lang="scss">
	.qrcode {
		width: 600rpx;
		padding: $side-width;

		image {
			width: 100%;
		}
	}
</style>